using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIEvent_ContentType_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIEvent.ContentType);

            field = type.GetField("Standard", flag);
            app.RegisterCLRFieldGetter(field, get_Standard_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Standard_0, null);
            field = type.GetField("Autocorrected", flag);
            app.RegisterCLRFieldGetter(field, get_Autocorrected_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_Autocorrected_1, null);
            field = type.GetField("IntegerNumber", flag);
            app.RegisterCLRFieldGetter(field, get_IntegerNumber_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_IntegerNumber_2, null);
            field = type.GetField("DecimalNumber", flag);
            app.RegisterCLRFieldGetter(field, get_DecimalNumber_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_DecimalNumber_3, null);
            field = type.GetField("Alphanumeric", flag);
            app.RegisterCLRFieldGetter(field, get_Alphanumeric_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_Alphanumeric_4, null);
            field = type.GetField("Name", flag);
            app.RegisterCLRFieldGetter(field, get_Name_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_Name_5, null);
            field = type.GetField("NumberAndName", flag);
            app.RegisterCLRFieldGetter(field, get_NumberAndName_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_NumberAndName_6, null);
            field = type.GetField("EmailAddress", flag);
            app.RegisterCLRFieldGetter(field, get_EmailAddress_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_EmailAddress_7, null);
            field = type.GetField("Password", flag);
            app.RegisterCLRFieldGetter(field, get_Password_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_Password_8, null);
            field = type.GetField("Pin", flag);
            app.RegisterCLRFieldGetter(field, get_Pin_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_Pin_9, null);
            field = type.GetField("Custom", flag);
            app.RegisterCLRFieldGetter(field, get_Custom_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_Custom_10, null);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIEvent.ContentType());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIEvent.ContentType[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.UIEvent.ContentType instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.UIEvent.ContentType[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_Standard_0(ref object o)
        {
            return huqiang.UIEvent.ContentType.Standard;
        }

        static StackObject* CopyToStack_Standard_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Standard;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Autocorrected_1(ref object o)
        {
            return huqiang.UIEvent.ContentType.Autocorrected;
        }

        static StackObject* CopyToStack_Autocorrected_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Autocorrected;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_IntegerNumber_2(ref object o)
        {
            return huqiang.UIEvent.ContentType.IntegerNumber;
        }

        static StackObject* CopyToStack_IntegerNumber_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.IntegerNumber;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_DecimalNumber_3(ref object o)
        {
            return huqiang.UIEvent.ContentType.DecimalNumber;
        }

        static StackObject* CopyToStack_DecimalNumber_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.DecimalNumber;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Alphanumeric_4(ref object o)
        {
            return huqiang.UIEvent.ContentType.Alphanumeric;
        }

        static StackObject* CopyToStack_Alphanumeric_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Alphanumeric;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Name_5(ref object o)
        {
            return huqiang.UIEvent.ContentType.Name;
        }

        static StackObject* CopyToStack_Name_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Name;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_NumberAndName_6(ref object o)
        {
            return huqiang.UIEvent.ContentType.NumberAndName;
        }

        static StackObject* CopyToStack_NumberAndName_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.NumberAndName;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_EmailAddress_7(ref object o)
        {
            return huqiang.UIEvent.ContentType.EmailAddress;
        }

        static StackObject* CopyToStack_EmailAddress_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.EmailAddress;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Password_8(ref object o)
        {
            return huqiang.UIEvent.ContentType.Password;
        }

        static StackObject* CopyToStack_Password_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Password;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Pin_9(ref object o)
        {
            return huqiang.UIEvent.ContentType.Pin;
        }

        static StackObject* CopyToStack_Pin_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Pin;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static object get_Custom_10(ref object o)
        {
            return huqiang.UIEvent.ContentType.Custom;
        }

        static StackObject* CopyToStack_Custom_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.UIEvent.ContentType.Custom;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.UIEvent.ContentType();
            ins = (huqiang.UIEvent.ContentType)o;
            return ins;
        }


    }
}
